<?php    
session_start();        
include('system/connect.php');   
$my_id = $_SESSION['my_id'];
$op_id = (int)$_GET['uid'];
$room_id = (int)$_GET['rid'];
$sql = "select * from chat2_chanels where user_id = '$op_id' limit 0,1";
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)) {
    $chanels = $row;
} 
if (!empty($chanels)) {
    $sql = "update chat2_room set with_video=0 where id = '$room_id'";
    $res = mysql_query($sql,$sock);     
   // echo($chanels['id']);
} else {
    echo(0);
}

?>